docServerUserLandCom picture
Contents
Frontier Site

string.addCommas

Syntax string.addCommas (number)

Params number is the numeric value to be formatted with commas.

Action Inserts commas at appropriate points in number.

Returns The reformatted number as a string.

Examples string.addCommas (10249)
"10,249"

string.addCommas (999999)
"999,999"

n1 = string.addCommas (49527);
n1 = n1 + 3
"49,5273"

Note that the + operator acts here a string concatenator since the original value has been converted to a string.

string.addCommas ("98765")
"98,765"

Note that the argument is a string enclosed in double quotation marks; Frontier coerces it to a number.

Notes You may supply a string as the number argument provided it can be coerced to a number.


© Copyright 1992-2026 UserLand Software. Email: webmaster@userland.com.